import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
	//一级路由
	{
		path: '/',
		redirect: 'login',
	},
	{
		path: '/login',
		name: 'login',
		component: () => import('../components/login/login.vue'),
		meta: {
			requireAuth: true
		}
	},
	//管理端
	{
		path: '/manage',
		name: 'manage',
		component: () => import('../components/Manage/manage.vue'),
		redirect: '/manage/nationFile',
		children: [{
				path: '/manage/nationFile',
				name: 'file',
				component: () => import('../components/nation/nationFile.vue')
			},
			{
				path: '/manage/regionFile',
				name: 'regionFile',
				component: () => import('../components/region/regionFile.vue')
			},
			{
				path: '/manage/crousel',
				name: 'crousel',
				component: () => import('../components/crousel/Crousel.vue')
			},
			{
				path: '/manage/festival',
				name: 'festival',
				component: () => import('../components/festival/festival.vue')
			}
		],
	}

]

const router = new VueRouter({
	mode: 'history',
	routes
})

export default router